// 设备数据接口
export interface DeviceData {
  deviceId: string;
  timestamp: number;
  data: Record<string, any>;
  messageType?: string;
}

// MQTT 消息接口
export interface MqttMessage {
  topic: string;
  payload: Buffer;
  qos: number;
  retain: boolean;
}

// InfluxDB 数据点接口
export interface DataPoint {
  measurement: string;
  tags: Record<string, string>;
  fields: Record<string, number | string | boolean>;
  timestamp?: Date;
}

// 应用配置接口
export interface AppConfig {
  port: number;
  nodeEnv: string;
  mqtt: {
    brokerUrl: string;
    clientId: string;
    username?: string;
    password?: string;
  };
  influx: {
    url: string;
    token: string;
    org: string;
    bucket: string;
  };
  logLevel: string;
}

// API 响应接口
export interface ApiResponse<T = any> {
  success: boolean;
  data?: T;
  message?: string;
  error?: string;
}
